package com.valentinalee.bms.web.servlet.filemanage3;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.valentinalee.bms.entity.FileSystemVO;
import com.valentinalee.bms.service.FileSystemService;
import com.valentinalee.bms.service.impl.FileSystemServiceImpl;


/**
 * 查询文件相关信息
 * @author iflysse
 *
 */
public class FileQuery2Servlet extends HttpServlet {
	
	FileSystemService service=new FileSystemServiceImpl();

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		
		//1.获取参数
		String id = req.getParameter("id");
		
		//2.调用service层代码
		FileSystemVO vo = service.getFileInfoById(id);
		
		//3.返回
		req.setAttribute("vo", vo);
		//4.跳转到以下页面
		req.getRequestDispatcher("/jsp/file/fileInfo2.jsp").forward(req, resp);
	}
	
	

}
